package com.dxjy.demo.module.sys.controller;

import com.dxjy.demo.entity.R;
import com.dxjy.demo.module.sys.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@Slf4j
@CrossOrigin
@Api(tags = "用户")
@RestController
@RequestMapping("/")
public class SysUserController {

	@Resource
	private SysUserService sysUserService;


	@RequiresRoles("admin")
	@ApiOperation(value = "用户列表")
	@GetMapping("/user/list")
	public R userList() {
		return sysUserService.getUserList();
	}

	@ApiOperation(value = "部门列表")
	@GetMapping("/dep/list")
	public R depList() {
		return sysUserService.getDepTerrList();
	}


}
